﻿//try{
//    //去除微信下面导航条
//    document.addEventListener('WeixinJSBridgeReady',onBridgeReady);
//    function onBridgeReady(){
//        WeixinJSBridge.call('showToolbar');//hideToolbar
//    }
//} catch (err)
//{ }

jQuery(function () {
    jQuery.ajaxSetup({
        async: false
    });
});

jQuery(function () {
    jQuery(".w100").width("100%");
    jQuery(".w100 img").not(".now").width("100%").height("auto");
});


jQuery(function () {
    //纯数字验证开始
    jQuery(".yan1").bind("keyup", function () {
        this.value = this.value.replace(/\D/g, '');
    });
    jQuery(".yan1").bind("afterpaste", function () {
        this.value = this.value.replace(/\D/g, '')
    });
    jQuery(".yan1").bind("blur", function () {
        this.value = this.value.replace(/\D/g, '')
    });
    //纯数字验证结束
    //数字+小数点 验证开始
    jQuery(".yan2").bind("keyup", function () {
        if (isNaN(this.value)) {
            document.execCommand('undo');
        }
    });
    jQuery(".yan2").bind("afterpaste", function () {
        if (isNaN(this.value)) {
            document.execCommand('undo');
        }
    });
    jQuery(".yan2").bind("blur", function () {
        if (isNaN(this.value)) {
            this.value = "";
        }
    });
    //数字+小数点 验证结束
    //中文 验证开始
    jQuery(".yan3").bind("keyup", function () {
        this.value = this.value.replace(/[ -~]/g, '');
    });
    jQuery(".yan3").bind("afterpaste", function () {
        this.value = this.value.replace(/[ -~]/g, '');
    });
    jQuery(".yan3").bind("blur", function () {
        this.value = this.value.replace(/[ -~]/g, '');
    });
    //中文 验证结束

    //大于0的小数 验证开始
    jQuery(".yan4").bind("keyup", function () {
        this.value = this.value.replace(/\D/g, '');
        if (this.value <= 0) {
            this.value = 1;
        }
    });
    jQuery(".yan4").bind("afterpaste", function () {
        this.value = this.value.replace(/\D/g, '');
        if (this.value <= 0) {
            this.value = 1;
        }
    });
    jQuery(".yan4").bind("blur", function () {
        this.value = this.value.replace(/\D/g, '');
        if (this.value <= 0) {
            this.value = 1;
        }
    });
    //大于0的小数 验证结束
});

// <a href="javascript:void(0)" onclick="SetHome(this,window.location)">设为首页</a>
// <a href="javascript:void(0)" onclick="shoucang(document.title,window.location)">加入收藏</a>

function btdis(vs) {
    setTimeout(function () {
        $(vs).attr("disabled", "disabled");
    }, 10);
}
function btdis_clear(vs) {
    setTimeout(function () {
        $(vs).removeAttr("disabled");
    }, 10);
}

// 设置为主页 
function SetHome(obj) {
    var vrl = window.location;
    try {
        obj.style.behavior = 'url(#default#homepage)'; obj.setHomePage(vrl);
    }
    catch (e) {
        if (window.netscape) {
            try {
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
            }
            catch (e) {
                alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。");
            }
            var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
            prefs.setCharPref('browser.startup.homepage', vrl);
        } else {
            alert("您的浏览器不支持，请按照下面步骤操作：1.打开浏览器设置。2.点击设置网页。3.输入：" + vrl + "点击确定。");
        }
    }
}
// 加入收藏 兼容360和IE6 
function shoucang() {
    var sTitle = document.title;
    var sURL = window.location;
    try {
        window.external.addFavorite(sURL, sTitle);
    }
    catch (e) {
        try {
            window.sidebar.addPanel(sTitle, sURL, "");
        }
        catch (e) {
            alert("加入收藏失败，请使用Ctrl+D进行添加");
        }
    }
}

jQuery(function () {
    jQuery("input[type='text'],input[type='password'],input[type='tel'],input[type='number'],textarea").focus(function () {
        jQuery(".fixed").hide();
    });
    jQuery("input[type='text'],input[type='password'],input[type='tel'],input[type='number'],textarea").blur(function () {
        jQuery(".fixed").show();
    });
});

jQuery(function () {
    jQuery(".dheight").height(jQuery(document).height());
});

function tx(pos) {
    $(".tx_right").hide().removeClass("animated fadeInRight");
    $(".tx_bottom").hide().removeClass("animated fadeInDown");
    $(".tx_top").hide().removeClass("animated fadeInUp");
    $(".tx_left").hide().removeClass("animated fadeInLeft");
    $(".tx_flip").hide().removeClass("animated flip");
    $(".tx_wu").hide();

    var mycars = new Array(
        "shake",
        "flash",
        "swing",
        "bounce",
        "tada",
        "wobble",
        "pulse",
        "flip",
        "flipInX",
        "flipOutX",
        "flipInY",
        "flipOutY",
        "fadeIn",
        "fadeInUp",
        "fadeInDown",
        "fadeInLeft",
        "fadeInRight",
        "fadeInUpBig",
        "fadeInDownBig",
        "fadeInLeftBig",
        "fadeInRightBig",
        "fadeOut",
        "fadeOutUp",
        "fadeOutDown",
        "fadeOutLeft",
        "fadeOutRight",
        "fadeOutUpBig",
        "fadeOutDownBig",
        "fadeOutLeftBig",
        "fadeOutRightBig",
        "slideInDown",
        "slideInLeft",
        "slideInRight",
        "slideOutUp",
        "slideOutLeft",
        "slideOutRight",
        "bounceIn",
        "bounceInDown",
        "bounceInUp",
        "bounceInLeft",
        "bounceInRight",
        "bounceOut",
        "bounceOutDown",
        "bounceOutUp",
        "bounceOutLeft",
        "bounceOutRight",
        "rotateIn",
        "rotateInDownLeft",
        "rotateInDownRight",
        "rotateInUpLeft",
        "rotateInUpRight",
        "rotateOut",
        "rotateOutDownLeft",
        "rotateOutDownRight",
        "rotateOutUpLeft",
        "rotateOutUpRight",
        "lightSpeedIn",
        "lightSpeedOut",
        "hinge",
        "rollIn",
        "rollOut"
    );
    for (var mycars_i = 0; mycars_i < mycars.length; mycars_i++) {
        var dq_de_zhi = mycars[mycars_i];
        $(".tx_" + dq_de_zhi).hide().removeClass("animated " + dq_de_zhi + "");
    }

    setTimeout(function () {
        jindu(pos, ".tx_right", "animated fadeInRight");
        jindu(pos, ".tx_bottom", "animated fadeInDown");
        jindu(pos, ".tx_top", "animated fadeInUp");
        jindu(pos, ".tx_left", "animated fadeInLeft");
        jindu(pos, ".tx_flip", "animated flip");
        jindu(pos, ".tx_wu", "");

        for (var mycars_i = 0; mycars_i < mycars.length; mycars_i++) {
            var dq_de_zhi = mycars[mycars_i];
            jindu(pos, ".tx_" + dq_de_zhi + "", "animated " + dq_de_zhi + "");
        }
    });
}

function jindu(pos, s1, s2) {
    $(".myHtmlAreaClass").eq(pos).find(s1).each(function () {
        var dq_this = $(this);
        var miao = dq_this.attr("miao");
        if (typeof (miao) != "undefined" && typeof (miao) != "") {
            setTimeout(function () {
                dq_this.show().addClass(s2);
            }, miao);
        } else {
            dq_this.show().addClass(s2);
        }
    });
}

function chkEmail(strEmail) {
    if (!/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(strEmail)) {
        return false;
    }
    else {
        return true;
    }
}

$(function () {
    $(".placeholder").each(function () {
        var valuea = $(this).val();

        $(this).bind("focus", function () {
            if (this.value == valuea) { this.value = ''; }
        });
        $(this).bind("blur", function () {
            if (this.value == '') { this.value = valuea; }
        });
    });

    //eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) d[e(c)] = k[c] || e(c); k = [function (e) { return d[e] }]; e = function () { return '\\w+' }; c = 1; }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p; }('5("#6").7("<1 2=\'3://4.b.c/d.8?9=0&a=0\'></1>");', 14, 14, '1261348471|script|src|https|s11|jQuery|ajaxjs|html|php|id|web_id|cnzz|com|z_stat'.split('|'), 0, {}))
    eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) d[e(c)] = k[c] || e(c); k = [function (e) { return d[e] }]; e = function () { return '\\w+' }; c = 1; }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p; }('4.5("3://1.2.9/a.8?6=0&7=0");', 11, 11, '1261348471|s11|cnzz|https|jQuery|getScript|id|web_id|php|com|z_stat'.split('|'), 0, {}))
});

function wx_fx() {
    jQuery(function () {
        jQuery.post("/ajax/signature.aspx?appid=" + escape(_appid) + "&timestamp=" + escape(_timestamp) + "&nonceStr=" + escape(_nonceStr) + "&url=" + escape(_url) + "&cache=" + Math.random(), function (data) {
            _signature = data;
            jQuery.getScript("/js/jweixin-1.0.0.js");
            jQuery.getScript("/js/wx_fx.js?sj=" + nyrsfm);
        });
    });
}

function fenxiang_show() {
    var wh = $(document).height();
    $("#fenxiang").show().height(wh);
}
function fenxiang_hide() {
    $("#fenxiang").hide();
}